package com.example.bookdemo.controller.utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ Author:郭子木
 * @ Date:2022/6/9
 * @ Time:16:55
 * @ Name:ProjectExceptionAdvice
 * @ Description:
 */

@RestControllerAdvice
public class ProjectExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public R doException(Exception e)
    {

        e.printStackTrace();
        return new R("error");
    }
}
